package com.imoocdl.utils;

import com.imoocdl.VO.ResultVO;
import com.imoocdl.enums.ResultEnum;

/**
 * Created by pc on 2018/7/17.
 */
public class ResultVOUtil {
    /**
     * 成功
     * @param object
     * @return
     */
    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        return resultVO;
    }
    /**
     * 空值
     */
    public static ResultVO success(){
        return success(null);
    }

    /**
     * 错误
     */
    public static ResultVO error(Integer code,String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setMsg(msg);
        resultVO.setCode(code);
        return resultVO;
    }

}
